<script>
import store from '@/store';
import Vue from 'vue';
import { mapMutations, mapActions, mapState } from 'vuex';
// #ifdef H5
	// import VConsole from '@/static/js/vconsole.min.js'
	// #endif
export default {
	methods:{
		...mapActions(['getCartList']),
		// 获取系统栏高度
		setAppInfo() {
			let that = this;
			let platform = '';
			uni.getSystemInfo({
				success: function(e) {
					Vue.prototype.StatusBar = e.statusBarHeight;
					// #ifdef H5
					Vue.prototype.CustomBar = e.statusBarHeight + 45;
					// #endif
		
					// #ifdef APP-PLUS
					platform = 'App';
					if (e.platform == 'android') {
						uni.setStorageSync('isAndroid', true);
						Vue.prototype.CustomBar = e.statusBarHeight + 50;
					} else {
						Vue.prototype.CustomBar = e.statusBarHeight + 45;
						uni.setStorageSync('isAndroid', false);
					}
					// #endif
		
					// #ifdef MP-WEIXIN
					platform = 'wxMiniProgram';
					let custom = wx.getMenuButtonBoundingClientRect();
					Vue.prototype.Custom = custom;
					Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
					// #endif
				}
			});
		}
	},
	onLaunch: function() {
		// #ifdef H5
		// var vConsole = new VConsole();
		// #endif
		this.getCartList()
		this.setAppInfo()
		// console.log('App Launch');
	},
	onShow: function() {
		this.$store.commit('CART_NUM');
		// uni.setStorageSync('cartNum',3)
		// this.$store.commit('CART_NUM');
		// console.log('App Show');
		// console.log(process.env.NODE_ENV)
	},
	onHide: function() {
		// console.log('App Hide');
	},
	mounted() {
		// uni.showTabBarRedDot ({
		// 	index: 2
		// })
		// uni.setTabBarBadge({
		//   index: 2,
		//   text: '22'
		// })
		// uni.removeTabBarBadge({
		// 	index: 2
		// })
	}
};
</script>

<style lang="scss">
	uni-tabbar .uni-tabbar-border { // tabBar上边框
	    background-color: #eaeaea!important; // tabBar上边框的颜色
	}
uni-tabbar .uni-tabbar__reddot {
	width: auto;
	height: 18px;
	line-height: 18px;
	border-radius: 16px;
	min-width: 18px;
	padding: 0 2px;
	font-size: 12px;
	text-align: center;
	white-space: nowrap;
	background-color: #FF2842;
}
view, scroll-view, swiper, button, input, textarea, label, navigator, image {
-webkit-box-sizing: border-box;
box-sizing: border-box;

}
.overhidden{
	white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.overhiddenTwo{
	text-overflow: -o-ellipsis-lastline;
	  overflow: hidden;
	  text-overflow: ellipsis;
	  display: -webkit-box;
	  -webkit-line-clamp: 2;
	  line-clamp: 2;
	  -webkit-box-orient: vertical;
}
.sc-tour-li-tags{
	text{
		margin-top: -10upx;
	}
}
.clearfix{
	clear: both;
}
/*每个页面公共css */
.place {
	font-size: 28upx;
	color: #e1e1e1;
}
page {
	background-color: #F8F8F8;
}

@font-face {
  font-family: 'iconfont';  /* project id 1600659 */
  src: url('https://at.alicdn.com/t/font_1600659_qsicfg1dxmi.eot');
  src: url('https://at.alicdn.com/t/font_1600659_qsicfg1dxmi.eot?#iefix') format('embedded-opentype'),
  url('https://at.alicdn.com/t/font_1600659_qsicfg1dxmi.woff2') format('woff2'),
  url('https://at.alicdn.com/t/font_1600659_qsicfg1dxmi.woff') format('woff'),
  url('https://at.alicdn.com/t/font_1600659_qsicfg1dxmi.ttf') format('truetype'),
  url('https://at.alicdn.com/t/font_1600659_qsicfg1dxmi.svg#iconfont') format('svg');
}
.icon {
	font-size: 32upx;
	color: #333;
	font-family: iconfont;
	font-style: normal;
	display: inline;
}
</style>
